package org.agile2soft.nexoma.expedient.entity;

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.agile2soft.nexoma.core.entity.InternalUser;

@Entity
@Table(name = "ENTRY_REG")
@SuppressWarnings({"serial"})
public class EntryReg implements java.io.Serializable {

    private Integer id;
    private InternalUser internalUser;
    private int number;
    private Date date;
    private String expose;
    private String documentRef;
    private String destinatary;
    private Date documentDate;

    public EntryReg() {
    }

    public EntryReg(int number, Date date, String destinatary,
            Date documentDate) {
        this.number = number;
        this.date = date;
        this.destinatary = destinatary;
        this.documentDate = documentDate;
    }

    public EntryReg(InternalUser internalUser, int number,
            Date date, String expose, String documentRef,
            String destinatary, Date documentDate) {
        this.internalUser = internalUser;
        this.number = number;
        this.date = date;
        this.expose = expose;
        this.documentRef = documentRef;
        this.destinatary = destinatary;
        this.documentDate = documentDate;
    }

    @Id
    @GeneratedValue(strategy = IDENTITY)
    @Column(name = "REG_ID", unique = true, nullable = false)
    public Integer getId() {
        return this.id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "USU_LOGIN")
    public InternalUser getInternalUser() {
        return this.internalUser;
    }

    public void setInternalUser(InternalUser internalUser) {
        this.internalUser = internalUser;
    }

    @Column(name = "REG_NUM", nullable = false)
    public int getNumber() {
        return this.number;
    }

    public void setNumber(int number) {
        this.number = number;
    }

    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "REG_DATE", nullable = false, length = 19)
    public Date getDate() {
        return this.date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    @Column(name = "REG_EXPOSE")
    public String getExpose() {
        return this.expose;
    }

    public void setExpose(String expose) {
        this.expose = expose;
    }

    @Column(name = "REG_DOC_REF", length = 250)
    public String getDocumentRef() {
        return this.documentRef;
    }

    public void setDocumentRef(String documentRef) {
        this.documentRef = documentRef;
    }

    @Column(name = "REG_DESTINATARY", nullable = false, length = 250)
    public String getDestinatary() {
        return this.destinatary;
    }

    public void setDestinatary(String destinatary) {
        this.destinatary = destinatary;
    }

    @Temporal(TemporalType.DATE)
    @Column(name = "REG_DOCUMENT_DATE", nullable = false, length = 10)
    public Date getDocumentDate() {
        return this.documentDate;
    }

    public void setDocumentDate(Date documentDate) {
        this.documentDate = documentDate;
    }

}
